package lesson01;

public class Demo04_Runnable {
    public static void main(String[] args) {
        MyRunnable01 myRunnable01 = new MyRunnable01();
        MyRunnable02 myRunnable02 = new MyRunnable02();
        Thread thread01 = new Thread(myRunnable01);
        Thread thread02 = new Thread(myRunnable01);
        Thread thread03 = new Thread(myRunnable02);
        thread01.start();
        thread02.start();
        thread03.start();
    }
}
class MyRunnable01 implements Runnable{
    @Override
    public void run() {
        while(true){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("在生产皮鞋  金币加1.....");
        }
    }
}
class MyRunnable02 implements Runnable{
    @Override
    public void run() {
        while(true){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("在生产皮包  金币加2.....");
        }
    }

}
